//根级别的state
// 4.设计vuex中用户的state getters mutations 
export const state={
  user:sessionStorage.getItem("user")?JSON.parse(sessionStorage.getItem("user")):{}
}

//根级别的getters
export const getters={
  user(state){
      return state.user
  }
}

//根级别的mutations
export const mutations={
  changeUser(state,user){
      state.user=user;
  }
}